local Msg = require("core.Msg")
local Lang = require("common.Lang")

function sendBroadcast(human, type, content)
	local msg = Msg.gc.GC_BROADCAST
	msg.type = type
	msg.msg = content
	Msg.send(msg, human.fd)
end

function sendUIBroadcast(human,panelID,content)
	local msg = Msg.gc.GC_UI_BROADCAST
	msg.panelID = panelID
	msg.msg = content
	Msg.send(msg, human.fd)
end

function sendBroadcastFDs(fds, type, content)
	local msg = Msg.gc.GC_BROADCAST
	msg.type = type
	msg.msg = content
	Msg.sendMulti(msg, fds)
end

function sendErr(human, err)
	local mm = Msg.gc.GC_BROADCAST
	mm.type = Lang.MOUSE
	mm.msg = err
	Msg.send(mm, human.fd)
end


function sendBroadcast2World(type, content)
	local mm = Msg.gc.GC_BROADCAST
	mm.type = type
	mm.msg = content
	Msg.sendAll(mm)
	
	--if type%(Lang.GROSSIP*2) - type%(Lang.GROSSIP/2) == Lang.GROSSIP then
	--	MinimapDB.addGossip(content)
	--end
end
